package org.example.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.example.vo.RegisterVo;
import org.example.utils.TimeUtils;

import java.util.Date;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class User {
    public User(RegisterVo registerVo, int isChild ){
        Date currentTime = TimeUtils.getCurrentTime();
        createTime = currentTime;
        updateTime = currentTime;
        this.name = registerVo.getName();
        this.account = registerVo.getAccount();
        this.password = registerVo.getPassword();
        this.isChild = isChild;
        monthLimit = 100;
        dayLimit = 10;
        exits=1;
    }
    @TableId
    public int id;
    public String name;
    public int monthLimit;
    public int dayLimit;
    public String account;
    public String password;
    //1是小孩 0是大人
    public int isChild;

    public String phone;
    public String gender;
    public String grade;
    public Date birthday;
    public Date createTime;
    public Date updateTime;
    public int exits;
}
